//
//  CXHUBiMAXNativeAd.h
//  CXHAdSDK-UBiMAX
//
//  Created by 陈坤 on 2025/7/28.
//

#import <Foundation/Foundation.h>
#import <CXHAdSDK-Core/CXHAdSDKNativeAd.h>

NS_ASSUME_NONNULL_BEGIN

@protocol CXHUBiMAXNativeAdDelegate;

@interface CXHUBiMAXNativeAd : NSObject
/**
 代理回调
*/
@property (nonatomic, weak) id<CXHUBiMAXNativeAdDelegate> delegate;

- (void)loadNativeAd:(NSString *)posid controller:(UIViewController *)controller count:(int)count;

/**
 获取竞价价格，单位分，为0则表示不支持竞价，开启该功能需要联系媒介商务
 */
- (NSInteger)getBidPrice;
/**
 发送竞价成功上报
 @param price 赢价价格，单位分
 */
- (void)sendWinNotice:(NSInteger)price;

/**
 发送竞价失败上报
 @param price 赢价价格，单位分
 */
- (void)sendLossNotice:(NSInteger)price;

@end

@protocol CXHAdapterNativeAdViewDelegate;

@protocol CXHUBiMAXNativeAdDelegate <NSObject>

@optional

/**
 信息流原生广告请求成功

 @param nativeAd 广告实例
 @param adViewArray 广告模板集合
 */
- (void)CXHUBiMAX_nativeAdSucessToLoad:(CXHAdSDKNativeAd *)nativeAd
                      adViewArray:(NSArray<__kindof UIView<CXHAdapterNativeAdViewDelegate> *> *)adViewArray;

/**
 信息流广告请求失败

 @param nativeAd 广告实例
 @param error 请求错误描述
 */
- (void)CXHUBiMAX_nativeAdFailToLoad:(CXHAdSDKNativeAd *)nativeAd
                     error:(NSError *)error;

/**
 信息流广告被点击

 @param nativeAd 广告模板
 */
- (void)CXHUBiMAX_nativeAdClicked:(CXHAdSDKNativeAd *)nativeAd
                      adView:(__kindof UIView<CXHAdapterNativeAdViewDelegate> *)adView loadingPageURL:(NSString *)loadingPageURL;

/**
 信息流广告被关闭
 
 @param nativeAd 广告模板
 */
- (void)CXHUBiMAX_nativeAdClose:(CXHAdSDKNativeAd *)nativeAd
                    adView:(__kindof UIView<CXHAdapterNativeAdViewDelegate> *)adView;

/**
 信息流广告被展示
 
 @param nativeAd 广告实例
 */
- (void)CXHUBiMAX_nativeAdExposure:(CXHAdSDKNativeAd *)nativeAd
                       adView:(__kindof UIView<CXHAdapterNativeAdViewDelegate> *)adView;

/**
 信息流广告展示上报
 
 @param nativeAd 广告实例
 */
- (void)CXHUBiMAX_nativeAdExposureReport:(CXHAdSDKNativeAd *)nativeAd
                       adView:(__kindof UIView<CXHAdapterNativeAdViewDelegate> *)adView;

/**
 信息流广告点击上报

 @param nativeAd 广告模板
 */
- (void)CXHUBiMAX_nativeAdClickedReport:(CXHAdSDKNativeAd *)nativeAd
                           adView:(__kindof UIView<CXHAdapterNativeAdViewDelegate> *)adView;

/**
 信息流广告落地页被关闭
 
 @param nativeAd 广告实例
 */
- (void)CXHUBiMAX_nativeAdCloseLandingPage:(CXHAdSDKNativeAd *)nativeAd
                       adView:(__kindof UIView<CXHAdapterNativeAdViewDelegate> *)adView;

@end

NS_ASSUME_NONNULL_END
